3.155 \(\int \cos (e+f x) (a+b \sec ^2(e+f x)) \, dx\)

Optimal. Leaf size=24 \[ \frac{a \sin (e+f x)}{f}+\frac{b \tanh ^{-1}(\sin (e+f x))}{f} \]

[Out]

(b*ArcTanh[Sin[e + f*x]])/f + (a*Sin[e + f*x])/f

________________________________________________________________________________________

Rubi [A]  time = 0.0275183, antiderivative size = 24, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.105, Rules used = {4045, 3770} \[ \frac{a \sin (e+f x)}{f}+\frac{b \tanh ^{-1}(\sin (e+f x))}{f} \]

Antiderivative was successfully verified.

[In]

Int[Cos[e + f*x]*(a + b*Sec[e + f*x]^2),x]

[Out]

(b*ArcTanh[Sin[e + f*x]])/f + (a*Sin[e + f*x])/f

Rule 4045

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*(csc[(e_.) + (f_.)*(x_)]^2*(C_.) + (A_)), x_Symbol] :> Simp[(A*Cot[e
 + f*x]*(b*Csc[e + f*x])^m)/(f*m), x] + Dist[(C*m + A*(m + 1))/(b^2*m), Int[(b*Csc[e + f*x])^(m + 2), x], x] /
; FreeQ[{b, e, f, A, C}, x] && NeQ[C*m + A*(m + 1), 0] && LeQ[m, -1]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \cos (e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx &=\frac{a \sin (e+f x)}{f}+b \int \sec (e+f x) \, dx\\ &=\frac{b \tanh ^{-1}(\sin (e+f x))}{f}+\frac{a \sin (e+f x)}{f}\\ \end{align*}

Mathematica [A]  time = 0.0172255, size = 35, normalized size = 1.46 \[ \frac{a \sin (e) \cos (f x)}{f}+\frac{a \cos (e) \sin (f x)}{f}+\frac{b \tanh ^{-1}(\sin (e+f x))}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[e + f*x]*(a + b*Sec[e + f*x]^2),x]

[Out]

(b*ArcTanh[Sin[e + f*x]])/f + (a*Cos[f*x]*Sin[e])/f + (a*Cos[e]*Sin[f*x])/f

________________________________________________________________________________________

Maple [A]  time = 0.046, size = 32, normalized size = 1.3 \begin{align*}{\frac{\sin \left ( fx+e \right ) a}{f}}+{\frac{b\ln \left ( \sec \left ( fx+e \right ) +\tan \left ( fx+e \right ) \right ) }{f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(f*x+e)*(a+b*sec(f*x+e)^2),x)

[Out]

a*sin(f*x+e)/f+1/f*b*ln(sec(f*x+e)+tan(f*x+e))

________________________________________________________________________________________

Maxima [A]  time = 0.986977, size = 51, normalized size = 2.12 \begin{align*} \frac{b{\left (\log \left (\sin \left (f x + e\right ) + 1\right ) - \log \left (\sin \left (f x + e\right ) - 1\right )\right )} + 2 \, a \sin \left (f x + e\right )}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)*(a+b*sec(f*x+e)^2),x, algorithm="maxima")

[Out]

1/2*(b*(log(sin(f*x + e) + 1) - log(sin(f*x + e) - 1)) + 2*a*sin(f*x + e))/f

________________________________________________________________________________________

Fricas [A]  time = 0.50083, size = 107, normalized size = 4.46 \begin{align*} \frac{b \log \left (\sin \left (f x + e\right ) + 1\right ) - b \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \, a \sin \left (f x + e\right )}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)*(a+b*sec(f*x+e)^2),x, algorithm="fricas")

[Out]

1/2*(b*log(sin(f*x + e) + 1) - b*log(-sin(f*x + e) + 1) + 2*a*sin(f*x + e))/f

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \sec ^{2}{\left (e + f x \right )}\right ) \cos{\left (e + f x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)*(a+b*sec(f*x+e)**2),x)

[Out]

Integral((a + b*sec(e + f*x)**2)*cos(e + f*x), x)

________________________________________________________________________________________

Giac [A]  time = 1.28577, size = 58, normalized size = 2.42 \begin{align*} \frac{b \log \left (\sin \left (f x + e\right ) + 1\right ) - b \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \, a \sin \left (f x + e\right )}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)*(a+b*sec(f*x+e)^2),x, algorithm="giac")

[Out]

1/2*(b*log(sin(f*x + e) + 1) - b*log(-sin(f*x + e) + 1) + 2*a*sin(f*x + e))/f